﻿using System.Configuration;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data.SqlClient;

namespace NewsPortal.Linq
{
    public static class DataContextFactory
    {
        private static readonly MappingSource mapping = new AttributeMappingSource();

        public static DataContext Create()
        {
            var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            connection.Open();
            return new DataContext(connection);
        }
    }
}
